<template>
  <div>
    <van-action-sheet
    @click-overlay="pp"
      v-model="show"
      :actions="actions"
      cancel-text="取消"
      description="请选择支付途径"
      close-on-click-action
      @select="onSelect"
      @cancel="onCancel"
    />
  </div>
</template>

<script>
  import { paySuccess} from "@/api/index"
export default {
  name: "payTarBar",
  data() {
    return {
      actions: [
        { name: "微信支付", color: "#04BE02" },
        { name: "支付宝支付", color: "#1678ff" },
      ],
    };
  },
  
  methods: {
    onSelect() {
      paySuccess({
        orderNo: this.orderNum,
        payType: 1,
      }).then((data) => {
        if (data.resultCode === 200) {
          this.$emit("getShow", false);
          this.$router.push("/order");
        }
      });
    },
    onCancel() {
      this.$router.push("/order");
    },
    pp(){
      this.$emit("getShow", false);
    }
  },
  props: ["show","orderNum"],
};
</script>
<style scoped>
</style>